<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>API Docs</title>
<link href="/scripts/style.css" rel="stylesheet" type="text/css" />

</head>

<body>      
<table width="780" border="0" align="center" cellpadding="10" cellspacing="0">
  <tr>
    <td><h1><strong>Welcome to the API toolkit for this  project.</strong></h1>
      <p>Many users have their own web sites  where they would like to host and brand their bug tracking without  needing to expose their bug tracker to the world. To answer this  we've built in an API tool that allows you to post information via  http post or curl request. Posting to the API will result in either a  success or error message depending on whether or not the task was  entered correctly into the system.</p>
      <p>There are two ways to use the  api. One will return  the variables to populate a form and the  other will post the task into the database.</p>
      <h2><strong>Getting Data</strong></h2>
      <p>If you wanted to dynamically get data  from the database. The results will always be provided as JSON. </p>
      <p><strong>URL:</strong></p>
      <p>http://yoururl/api/get</p>
      <p><strong>Values you can get: </strong></p>
      <ul>
        <li> projects</li>
        <li> users</li>
      </ul>
      <p><strong>Example: </strong></p>
      <p>For example to get  the status codes dynamically from the database point your code to:</p>
      <blockquote>
        <p>http://yoururl/api/get/?values=projects&amp;apikey=your@emailaddress.com</p>
        <p>returns projects_json.txt</p>
        <p>containing [{&quot;ProjectID&quot;:&quot;1&quot;,&quot;project_label&quot;:&quot;Test Project&quot;}]</p>
      </blockquote>
      <p>Subsiquently if you do not want the file downloaded add the switch download=off</p>
      <blockquote>
        <p>http://yoururl/api/get/?values=projects&amp;apikey=your@emailaddress.com&amp;download=off</p>
        <p>Returns: </p>
        <p>[{&quot;ProjectID&quot;:&quot;1&quot;,&quot;project_label&quot;:&quot;Test Project&quot;}]</p>
      </blockquote>
      <h2><strong>Posting Tasks</strong></h2>
      <p>Posting from a form or through a  backend script to the url will insert the task into the database  directly. Missing values will be inserted with default ones so you  don't have to worry about much but posting.</p>
      <p><strong>URL: </strong></p>
      <p>http://yoururl/api/submit/</p>
      <p><strong>Values you can post:</strong></p>
      <p><strong>Required</strong></p>
      <blockquote>
        <p> <strong>subj</strong> - Subject of the task - limit 128 characters</p>
        <p><strong>body</strong> - Body text of the actual task</p>
        <p> <strong>proj</strong> - a Project ID  is required to add tasks</p>
      </blockquote>
      <p><strong> Other Values:</strong></p>
      <blockquote>
        <p><strong>status</strong></p>
        <p><strong>type</strong></p>
        <p><strong>user</strong></p>
        <p><strong>priority</strong></p>
      </blockquote>
      <p><strong>Response from the server:</strong></p>
      <blockquote>
        <p> <strong>Success</strong></p>
        <p> <strong>Failure: </strong>the error detail</p>
      </blockquote>
      <p><strong>Example:</strong></p>
      <p>http://yoururl/api/submit/?subj=Testing%20Task&amp;body=this%20is%20a%20task&amp;proj=1&amp;status=1&amp;type=1&amp;user=1&amp;priority=0</p></td>
  </tr>
</table>
</body>
</html>